{template "header.html"}


<section class="main-content-area">
    <div class="container">
        <!-- bradcame start -->
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="greentect_bradcame">
                    <ul>
                        <li><a href="{SITE_URL}">首页</a></li>
                        {dr_catpos($catid, '', true, '<li> <a href="[url]">[name]</a> </li>')}
                        <li>结果</li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- bradcame end -->
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="portlet light bordered" style="box-shadow:0 0px 0px 0px rgba(0,0,0,.03)">
                    <div class="portlet-title">
                        <div class="caption">
                            <span class="caption-subject ">条件筛选</span>
                        </div>
                    </div>
                    <div class="portlet-body form fc-search-param">
                        <div class="form-body">
                            <div class="form-group row">
                                <label class="col-md-2 control-label">栏目分类</label>
                                <div class="col-md-9">
                                    <label><a class="label {if !$cat || $cat.child}label-success{else}label-default{/if}" href="{dr_search_url($params, 'catdir', NULL)}">不限</a></label>
                                    <!--调用栏目分类，这种用法只能用于模块列表与搜索页面-->
                                    {loop $related $t}
                                    <label><a class="label {if $t.id==$cat.id}label-success{else}label-default{/if}" href="{dr_search_url($params, 'catdir', $t.dirname)}">{$t.name}</a></label>
                                    {/loop}
                                </div>
                            </div>

                            <!--category_search_field是调用当前栏目下的附加字段是否具有搜索字段功能，这种用法只能用于模块列表与搜索页面-->
                            {category_search_field module=MOD_DIR catid=$catid}
                            <div class="form-group row">
                                <label class="col-md-2 control-label">{$t.name}</label>
                                <div class="col-md-9">
                                    <label><a class="label {if !$params[$t.field]}label-success{else}label-default{/if}" href="{dr_search_url($params, $t.field, NULL)}">不限</a></label>
                                    {loop $t.data $v}
                                    <label><a class="label {if $v.value==$params[$t.field]}label-success{else}label-default{/if}" href="{dr_search_url($params, $t.field, $v.value)}">{$v.name}</a></label>
                                    {/loop}
                                </div>
                            </div>
                            {/category_search_field}

                            <!--按联动菜单搜索-->
                            <div class="form-group row">
                                <label class="col-md-2 control-label">所在地</label>
                                <div class="col-md-9">
                                    <label><a class="label {if !$params.city || dr_linkage('address', $params.city, 0, 'child')}label-success{else}label-default{/if}" href="{dr_search_url($params, 'city', NULL)}">不限</a></label>
                                    <!--调用联动菜单address，pid为动态获取的地区id-->
                                    {list action=linkage code=address pid=$params.city}
                                    <label><a class="label {if $t.id==$params.city}label-success{else}label-default{/if}" href="{dr_search_url($params, 'city', $t.id)}">{$t.name}</a></label>
                                    {/list}
                                </div>
                            </div>

                            <!--包邮-->
                            <div class="form-group row">
                                <label class="col-md-2 control-label">运费策略</label>
                                <div class="col-md-9">
                                    <label><a class="label {if !isset($params.shipping)}label-success{else}label-default{/if}" href="{dr_search_url($params, 'shipping', NULL)}">不限</a></label>

                                    <label><a class="label {if isset($params.shipping) && 0==$params.shipping}label-success{else}label-default{/if}" href="{dr_search_url($params, 'shipping', 0)}">包邮</a></label>

                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-md-2 control-label">价格筛选</label>
                                <div class="col-md-9">
                                    {php $price = explode(',', $params.price);}
                                    <label><input type="text" class="form-control" value="{$price[0]}" id="price_min"></label>
                                    <label style="padding-top: 5px;">到</label>
                                    <label><input type="text" class="form-control" value="{$price[1]}" id="price_max"></label>
                                </div>
                            </div>

                            <!--按关键字搜索-->
                            <div class="form-group row">
                                <label class="col-md-2 control-label" style="padding-top:5px">商品搜索</label>
                                <div class="col-md-6">
                                    <div class="input-group">
                                        <input type="text" class="form-control" onkeypress="if(event.keyCode==13) {dr_module_search();return false;}" name='keyword' value='{$keyword}' id='search_keyword'>
                                        <span class="input-group-btn">
                                                        <button class="btn blue" onclick="dr_module_search()" type="button"> <i class="fa fa-search"></i> 搜索</button>
                                                    </span>
                                    </div>
                                </div>
                            </div>
                            <script>
                                // 这段js是用来执行搜索的
                                function dr_module_search(name) {
                                    var url="{dr_search_url($params, ['keyword', 'price'], ['mykeyword', 'myprice'])}";
                                    var keyword = $("#search_keyword").val();
                                    var price_min = $("#price_min").val();
                                    var price_max = $("#price_max").val();
                                    price_max = price_max ? price_max : 0;
                                    price_min = price_min ? price_min : 0;
                                    if (price_max || price_min) {
                                        url = url.replace('myprice', price_min+','+price_max);
                                    } else {
                                        url = url.replace('myprice', '');
                                    }
                                    if (keyword) {
                                        url = url.replace('mykeyword', keyword);
                                    } else {
                                        url = url.replace('mykeyword', '');
                                    }
                                    location.href=url;
                                    return false;
                                }
                            </script>

                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class=" tabbable-line">
            <ul class="nav nav-tabs">
                <li class="{if !$params.order || $param.order=='updatetime'}active{/if}"><a href="{dr_search_url($params, 'order', null)}"> 时间排序 </a></li>
                <li class="{if $params.order=='hits'}active{/if}"><a href="{dr_search_url($params, 'order', 'hits')}"> 点击排序 </a></li>
                <li class="{if $params.order=='comments'}active{/if}"><a href="{dr_search_url($params, 'order', 'comments')}"> 评论排序 </a></li>
                <li class="{if $params.order=='avgsort'}active{/if}"><a href="{dr_search_url($params, 'order', 'avgsort')}"> 评分排序 </a></li>
                <li class="{if $params.order=='volume'}active{/if}"><a href="{dr_search_url($params, 'order', 'volume')}"> 销量排序 </a></li>
                <li class="{if $params.order=='price'}active{/if}"><a href="{dr_search_url($params, 'order', 'price')}"> 价格高低排序 </a></li>
                <li class="{if $params.order=='price_asc'}active{/if}"><a href="{dr_search_url($params, 'order', 'price_asc')}"> 价格低高排序 </a></li>

            </ul>
        </div>


        <div class="row all-grid-product" style="clear: both; margin-top: 30px">
            <!-- single-product-item start -->
            {search module=MOD_DIR id=$searchid total=$sototal order=$params.order catid=$catid page=1 pagesize=12 urlrule=$urlrule return=r}
            <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
                <div class="single-product-item">
                    <div class="product-image">
                        <a href="{$r.url}" target="_blank"><img src="{dr_thumb($r[thumb][0][file], 200, 160)}" alt="{$r.title}" /></a>
                        <div class="single-product-overlay">
                            <div class="rating-box">
                                {dr_mall_star_level($r.avgsort)}
                            </div>
                            <div class="product-quick-view">
                                <ul>
                                    <li><a href="javascript:dr_mall_favorite('goods', '{$r.id}');" class="heart {if dr_is_mall_favorite($r.id)} mylike{/if}" id="dr_mylike_{$r.id}"><i class="fa fa-heart-o"></i></a></li>
                                    <li><a href="{$r.url}"><i class="fa fa-eye"></i></a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="single-product-text">
                        <h2><a class="product-title" href="{$r.url}" target="_blank">{dr_strcut($r.title, 22)}</a></h2>
                        <div class="product-price">
                            <span class="regular-price">￥{number_format($r.price, 2)}</span>
                        </div>
                        <div class="pro-add-to-cart">
                            <p><a href="javascript:dr_select_cart('goods', 'price', '{$r.id}');" title="添加购物车">添加购物车</a></p>
                        </div>
                    </div>
                </div>
            </div>
            {/search}

        </div>

        <div class="mall-page">
            <ul class="pagination">
                {$pages}
            </ul>
        </div>

    </div>
</section>



{template "footer.html"}